package com.jews.example.demo.domain.user.vo;

import com.jews.common.constants.ValidStatus;
import com.jews.example.demo.domain.user.User;
import com.jews.jpa.support.AbstractBaseJpaVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 业务层(Service)响应对象
 * 命名规则：XxxVO
 *
 * @author JewsChen
 * @title: UserVO
 * @date 2022/11/29 23:29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class UserVO extends AbstractBaseJpaVO {

    /**
     * 手机号
     */
    private String phone;

    /**
     * 用户名
     */
    private String username;

    /**
     * 部门ID
     */
    private Long departmentId;

    /**
     * 额外信息
     */
    private String extInfo;

    /**
     * 数据状态
     */
    private ValidStatus validStatus;

    public UserVO(User source) {
        super(source);
        this.setPhone(source.getPhone());
        this.setUsername(source.getUsername());
        this.setDepartmentId(source.getDepartmentId());
        this.setExtInfo(source.getExtInfo());
        this.setValidStatus(source.getValidStatus());
    }
}
